package com.gridmobi.xrtb.domain.dsp.common;

import com.google.common.collect.ImmutableList;

import java.util.List;

public class AppConstant {

    public static boolean NONERESPONSE = true;
    public static String IMP_INDEX = "rtbimp";
    public static String CLICK_INDEX = "rtbclick";
    public static String LAND_INDEX = "rtbcland";

    public static String WIN_INDEX = "rtbwin";
    public static String LOSS_INDEX = "rtbloss";

    public static String BID_INDEX = "rtbbid";
    public static String CONV_INDEX = "rtbconvert";

    public static String REQUESTS_INDEX = "rtbreq";


    /**
     * redis key prefix
     */
    public static String IMP = "imp";
    public static String CLICK = "click";
    public static String WIN = "win";
    public static String BID = "bid";
    public static String QPS = "qps";
    public static String ERRORS = "errors";
    public static String REQUESTS = "requests";
    public static String BUDGET_DAILY = "daily";
    public static String BUDGET_LIFE = "life";
    public static String IMPUSER = "impuser";
    public final static String CONV_PREFIX = "conv";
    public final static String TARGET_PREFIX = "tag";
    public final static String IMPLIMIT_PREFIX = "imp";

    public static String DEFAULT_CFGV = "All";
    public static String LOG_SEPARATOR = "|";
    public static String LOG_SEPARATOR_SUB = "@";
    public static String SEPARATOR = "^";
    public static String URL_SEPARATOR = "-";
    public static String LANDURLPREFIX = "track";


    /**
     * dsp web rootpath 根路径
     */
    public static String DSP_ROOT_PATH = "/api/";

    public static String DEFAULT_ORDER_CLAUSE = " id desc";

    public static String ORDER_CLAUSE_UPDATETIME = " updatetime desc";
    /**
     * dsp banner size 列表 width X height
     */
    public static List<String> BANNER_SIZES = new ImmutableList.Builder<String>()
            .add("320X50")
            .add("320X480")
            .add("480X320")
            .add("728X90")
            .add("768X1024")
            .add("1024X768")
            .add("480X80")
            .add("480X800")
            .add("800X480")
            .add("300X50")
            .add("300X250")
            .add("216X36")
            .add("300X600").build();


    /**
     * es index 的 默认type
     */
    public static final String DEFAULT_ES_TYPE = "doc";
    /**
     * 系统自动检测index 时候会自动预创建多个索引,比如 每小时一个索引，提前创建20个小时的索引
     */
    public static final String DEFAULT_ES_INDEX_ID = "1";

    /**
     * 如果是无法track到win信息的imp 以及 click 以及conv 都属于 NO_BID_REQID
     */
    public static final String NO_BID_REQID = "1";
    /**
     * bid 状态更新topic 比如当 win  imp  click 通知回来时候 修改bid 原始Log状态 后续好应用于报表
     */
    public static final String BID_STATUS_UPDATE_TOPIC = "rtbbidstatusupdate";
    public static final String BID_STATUS_UPDATE_RETRY_TOPIC = "rtbbidstatusupdateretry";

    public static final String BID_STATUS_UPDATE_INDEX = "rtbbidstatusupdate";
    /**
     * Resource Menu Parent
     */
    public static final Integer ROOT_MENU = 0;


    public static void main(String[] args) {
        System.out.println(BANNER_SIZES.toString());
    }

    /**
     * 自动维护
     */
    public static final Integer AUTO = 1;

    public static final Integer CLICKID_LENGTH = 100;



}
